
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	template="/template/main.xhtml">

	<ui:define name="body">
		<h:form>
			<p:dataTable id="list" var="bean"
				value="#{notaFiscalListMB.lazyModel}" lazy="true" paginator="true"
				first="#{messages['page.first']}" rows="#{messages['page.rows']}">
				<f:facet name="header">#{messages['notaFiscal.list.table.title']}</f:facet>
				<p:column width="5%" sortBy="#{bean.serie}">
					<f:facet name="header">#{messages['notaFiscal.label.serie']}</f:facet>
					<h:commandLink action="#{notaFiscalListMB.getNextView}"
						actionListener="#{notaFiscalListMB.clear}">
						<h:outputText value="#{bean.serie}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>

				<p:column width="8%" sortBy="#{bean.numero}">
					<f:facet name="header">#{messages['notaFiscal.label.numero']}</f:facet>
					<h:commandLink action="#{notaFiscalListMB.getNextView}"
						actionListener="#{notaFiscalListMB.clear}">
						<h:outputText value="#{bean.numero}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
				<p:column width="7%" sortBy="#{bean.modelo}">
					<f:facet name="header">#{messages['notaFiscal.label.modelo']}</f:facet>
					<h:commandLink action="#{notaFiscalListMB.getNextView}"
						actionListener="#{notaFiscalListMB.clear}">
						<h:outputText value="#{bean.modelo}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
				<p:column sortBy="#{bean.clienteNotaFiscal.nome}">
					<f:facet name="header">#{messages['cliente.label.nome']}</f:facet>
					<h:commandLink action="#{notaFiscalListMB.getNextView}"
						actionListener="#{notaFiscalListMB.clear}">
						<h:outputText value="#{bean.clienteNotaFiscal.nome}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
				<p:column width="10%" sortBy="#{bean.dataEmissao}">
					<f:facet name="header">#{messages['notaFiscal.label.dataEmissao']}</f:facet>
					<h:commandLink action="#{notaFiscalListMB.getNextView}"
						actionListener="#{notaFiscalListMB.clear}">
						<h:outputText value="#{bean.dataEmissao}">
							<f:convertDateTime pattern="#{messages['label.date.pattern']}"/>
						</h:outputText>
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>

				<p:column width="15%" sortBy="#{bean.valorTotalNota}">
					<f:facet name="header">#{messages['notaFiscal.label.valorTotalNota']}</f:facet>
					<h:commandLink action="#{notaFiscalListMB.getNextView}"
						actionListener="#{notaFiscalListMB.clear}">
						<h:outputText value="#{bean.valorTotalNota}">
							<f:convertNumber  pattern="#{messages['label.valor.pattern']}"/>
						</h:outputText>
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
				<p:column width="15%" sortBy="#{bean.valorTotalTributos}">
					<f:facet name="header">#{messages['notaFiscal.label.valorTotalTributos']}</f:facet>
					<h:commandLink action="#{notaFiscalListMB.getNextView}"
						actionListener="#{notaFiscalListMB.clear}">
						<h:outputText value="#{bean.valorTotalTributos}">
							<f:convertNumber  pattern="#{messages['label.valor.pattern']}"/>
						</h:outputText>
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>

			</p:dataTable>
		</h:form>

	</ui:define>
</ui:composition>